// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 新增峰谷套利 POST /fenggu/add */
export async function fengguControllerAddFengguInfo(
  body: API.AddFengguReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/fenggu/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除峰谷套利 DELETE /fenggu/batchDel */
export async function fengguControllerBatchDelFengguInfo(
  body: number[],
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/fenggu/batchDel`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除峰谷套利 DELETE /fenggu/del/${param0} */
export async function fengguControllerDelFengguInfo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fengguControllerDelFengguInfoParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ApiResult>(`${apiPrefix}/fenggu/del/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 编辑峰谷套利 PUT /fenggu/edit */
export async function fengguControllerEditFengguInfo(
  body: API.EditFengguReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/fenggu/edit`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询峰谷套利列表 GET /fenggu/list */
export async function fengguControllerGetPageList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fengguControllerGetPageListParams,
  options?: { [key: string]: any },
) {
  return request<API.Pagination>(`${apiPrefix}/fenggu/list`, {
    method: 'GET',
    params: {
      ...params,
      page: undefined,
      ...params['page'],
    },
    ...(options || {}),
  });
}
